package com.example.haojiutao.mapper;

import com.example.haojiutao.model.domain.Goods;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;

/**
 * @Description: 商品持久层
 * @Author: ma_lihong
 * @CreateTime: 2024/1/16 16:53
 */
@Mapper
public interface GoodsMapper {
    /*
     * @Description:出售闲置
     * @Author: ma_lihong
     * @CreateTime: 2024/1/16 16:53
     * @param: goods
     * @return: com.example.haojiutao.common.Result
     */
    int insertGoods(Goods goods);

    /*
     * @Description:更新商品价格，图片，详情，品牌
     * @Author: ma_lihong
     * @CreateTime: 2024/1/16 19:39
     * @param: goods
     * @return: com.example.haojiutao.common.Result
     */
    int updateGoods(Goods goods);

    /*
     * @Description:下架商品,删除商品
     * @Author: ma_lihong
     * @CreateTime: 2024/1/17 20:47
     * @param: goods
     * @return: com.example.haojiutao.common.Result
     */
    int deleteGoods(Goods goods);

    /*
     * @Description:根据商品名称搜索商品
     * @Author: ma_lihong
     * @CreateTime: 2024/1/17 21:04
     * @return: com.example.haojiutao.common.Result
     */
    List<Goods> selectByName(Goods goods);

    /*
     * @Description: 查看单个物品，根据id查询
     * @Author: ma_lihong
     * @CreateTime: 2024/1/18  14:21
     * @param: goods
     * @return: com.example.haojiutao.common.Result
     */
    Goods selectById(int goodsId);

    //查看我卖出的商品
    List<Goods> getRecommendbuy(Goods goods);


    int addGoods(Goods goods);


    Goods getGoodsByUserId(Goods goods);


//查看我发布的商品


    List<Goods> getRecommendFabu(Goods goods);

    Integer relistGoods(Goods goods);

    Integer listGoods(Goods goods);


}